* Clean up
clear all

/* Set working directory: please set your own
cd "~/Dropbox/JOP third submission/JOP replication/"
*/

use 01_data/cis_data.dta, clear

* Run analyses

regr cabine_use pp_dummy, r
est store pp_nocontrols
estadd local Controls "No"
estadd local FE "No"

regr cabine_use pp_dummy i.CCAA, r
est store pp_fe
estadd local Controls "No"
estadd local  FE "Yes"

regr cabine_use pp_dummy female i.income age age_sq i.education i.TAMUNI, r
est store pp_controls
estadd local Controls "Yes"
estadd local  FE "No"

regr cabine_use pp_dummy female i.income age age_sq i.education i.TAMUNI i.CCAA, r
est store pp_fe_controls
estadd local Controls "Yes"
estadd local  FE "Yes"

* Make table 
esttab pp_nocontrols pp_fe pp_controls pp_fe_controls using 03_tables/table5.tex, tex se replace keep(pp_dummy) coeflabels (pp_dummy "PP voter (dummy)") nomtitles star(* 0.10 ** 0.05 *** 0.01) s(Controls FE, label("Controls" "Region fixed effects")) addnotes("Standard errors are robust" "The outcome variable is a dummy for whether each respondent used a private" "voting booth to cast their vote in the general election of November 2019" "Models 2 and 4 include controls for income, education, age, age squared, size of" "respondent's municipality, and a dummy for respondents identifying as female") scalars(e(N))
